package org.tloss.web.editor;

import org.eclipse.core.resources.IProject;
import org.tloss.web.editor.database.editors.jdbc.Table;

public class GeneratorHelper {
	IProject project;

	public void setProject(IProject project) {
		this.project = project;
	}

	public Table loadEnity(Table table) {
		return loadEnity(table.getTableName());
	}

	private Table loadEnity(String tableName) {
		return Utils.loadEnity(project, tableName);
	}

	public boolean instanceOf(Object object, String className)
			throws ClassNotFoundException {
		if (object != null && className != null) {
			return Class.forName(className).isAssignableFrom(object.getClass());
		} else {
			throw new NullPointerException();
		}
	}

}
